% Calls the makeVector function on the image to classify,
% gets the number of features for the image to classify,
% this is needed because when I compare, features matrix 
% dimensions must match.
% I get the variance between the image features and 
% the data structure from my learn function, then get
% the mean of that.

function c = classify(d, im)
    x = makeVector(im);
    sizeX  = size(x,2);

    results = [];
    for i = 1:2
        for j = 1:size(d,2)
            sizeD = size(d{i,j},2);
            minSize = min(sizeD,sizeX);
            comp = [x(1:minSize);d{i,j}(1:minSize)];
            variance = var(comp);
            results(i,j) = mean(variance);
        end
    end
    if min(results(1,:)) > min(results(2,:))
        c = 'car';
    else
        c = 'cat';
    end


    
    
    
    